package com.meilai.project.dto.app;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.meilai.project.util.RegexUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author 张驰
 * @date 2021/10/29 23:34
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@ApiModel(value="请求对象-app手机号登录", description="请求对象-app手机号登录")
public class MobileLoginDTO implements Serializable {
    private static final long serialVersionUID = 7288332836577437462L;

    @NotNull(message = "短信验证码不能为空")
    @ApiModelProperty(value = "短信验证码", required = true)
    private String code;

    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = RegexUtil.REG_MOBILE, message = "手机号格式有误")
    @ApiModelProperty(value = "手机号", required = true)
    private String mobile;
}
